/*
 * Copyright @ 苏州瑞云信息技术有限公司 All rights reserved.
 */
package work.base.data.map;

import java.util.Collection;
import java.util.HashMap;
import java.util.Map;
import java.util.Stack;

/**
 * @author Sakura Shen
 * @description
 * @date 2021/7/15
 */
public class MapTest {

    public static void main(String[] args) {

        // 使用map的entrySet()方法对map进行遍历
        Map<String,String> maps = new HashMap<>();
        maps.put("1","AA");
        maps.put("2","BB");
        maps.put("3","CC");
        for (Map.Entry<String, String> entry : maps.entrySet()) {
            System.out.println("key:" + entry.getKey() + ";value:" + entry.getValue());
        }

        // values() 方法返回映射中所有 value 组成的 Set 视图。
        Collection<String> collections = maps.values();
        System.out.println(collections);

        System.out.println("END");


    }
}
